Mapping Groundhog Day Prognosticators
The locations of the prognosticators were added to an interactive leaflet map using the longitude and latitude values provided in the original dataset. Awesome icons, a marker that is built into the base leaflet package, was used to add markers with icons indicating the status of the prognosticator and colors indicating the type. Legends were added via leaflegend.
Mapping Groundhog Habitat Range
The groundhog habitat range shape file was obtained from the International Union for the Conservation of Nature. The terrestrial mammal polygon file was downloaded, then filtered to Marmota monax in R Studio and saved as a new file. The filtered shapefile was stored by each collaborator locally due to the size of the file. The shape file was added to the leaflet map using addPolygons from the leaflet package.
Retrieving Historical Weather Data
Using latitude and longitude values provided in the original groundhog dataset, we queried NASA POWER data for each groundhog location. For each location, we collected average daily surface temperature (T2M) between 01/01/1981 and 07/01/2025. The resulting dataset was then written to a CSV file and saved in the project’s data directory. This allowed the analysis to remain reproducible while avoiding the need to re-query the nasapower database each time the script was run.
Assessing Prediction Accuracy
Each groundhog prediction falls into one of two categories:
To evaluate prediction accuracy, we divided the seasonal temperature data into three six-week windows:
For each window, we calculated the mean daily temperature. We then determined whether the observed temperature during the prediction window was more similar to winter or spring conditions by comparing its distance from the winter and spring averages. A prediction was classified as correct if the groundhog’s prediction matched the observed weather conditions.
Comparing Prognosticator Accuracy
To compare performance across prognosticators, we calculated overall accuracy as the proportion of correct predictions out of total predictions made by each groundhog. Prognosticators were then ranked by this accuracy metric. These results were displayed in an interactive leaderboard, allowing users to explore accuracy rankings alongside summarizing information about each prognosticator, including details such as location, number of years prognosticating, and links to their profiles.
Assessing Seasonal Consistency
An easy gig for a professional prognosticator would be to prognosticate in a locale with very consistent climate. We’re lookin’ at you, “Dunkirk Dave!” To quantify weather consistency, we looked at the proportion of times during each prognosticator’s career that there were six more weeks of winter according to our model. Therefore, a maximally inconsistent climate pattern would be 0.5 (half the time there are six more weeks, and half the time there was early spring). We took the difference of this value from one (1 minus inconsistency) to state the Climate Consistency Index.
Correcting Prognosticator Accuracy
To assess the accuracy of prognosticators in the context of the advantage that climate consistency confers, we calculated a corrected accuracy by multiplying the climate consistency index by accuracy. \[ A_{corrected} = Accuracy * [1 - |0.5 - (\sum\limits_{i=1}^{n} i \div \sum\limits_{j=1}^n j) |] \]
\[ \begin{equation} \text{Where } i = \text{ a year saw shadow and } \\ j = \text{ a year a prediction was rendered} \end{equation} \]
Original Data: Tidy Tuesday
Prognosticators and Predictions: Groundhog Day Website
Weather Data API: NASA POWER
Groundhog Habitat Range: IUCN. 2025. The IUCN Red List of Threatened Species. Version 2025-2. https://www.iucnredlist.org. Accessed on December 7, 2025.
leaflet
The leaflet package was used to create an interactive map of Groundhog Day prognosticators. The function addAwesomeIcons was used to create icons for each prognosticator where the shape referenced the status of the prognosticator (alive, dead, or never alive/inanimate) and the color referenced the type of prognosticator (groundhog or non-groundhog). The icons are from the Font Awesome 4.7 library, which are included in leaflet and accessable via addAwesomeIcons.
nasapower
The nasapower package provides an interface for easily accessing NASA POWER (Prediction Of Worldwide Energy Resource) global climatology and meteorology data directly within R and in a tidy format. We used this package to retrieve daily average surface air temperature at 2 meters above the surface (T2M) for each prognosticator location. This particular data set has a spatial resolution of 0.5 × 0.625 degrees latitude × longitude, an hourly temporal resolution, and historical coverage dating back to January 1st, 1981. This package allowed us to link historical temperature data for each prognosticator’s geographic location, which facilitated our assessment of each Groundhog Day prediction.
reactable and reactablefmtr
The reactable package was used to render interactive tables within the R Markdown flexdashboard. It provides a suite of built-in table features, such as searching and filtering rows, nesting data with expandable rows, and customizing the display. The reactablefmtr package further extends this functionality to enable additional styling and table features, including embedded images and displaying subplots in rows. These packages were used extensively to create the Groundhog Leaderboard, allowing users to interactively explore and compare Groundhog Day prognosticators.
htmltools
The htmltools package was used to further customize the Groundhog leaderboard beyond what was natively supported by existing R packages. By embedding custom HTML elements within table itself, we were able to control layout and behavior at a finer level. For example, htmltools was used to generate hyperlinked prognosticator names, allowing users to click directly from the leaderboard to external profile pages.
[1] "Aden-Buie G, Sievert C, Iannone R, Allaire J, Borges B (2023).\n_flexdashboard: R Markdown Format for Flexible Dashboards_.\ndoi:10.32614/CRAN.package.flexdashboard\n<https://doi.org/10.32614/CRAN.package.flexdashboard>, R package\nversion 0.6.2, <https://CRAN.R-project.org/package=flexdashboard>."
[1] "Wickham H, Averick M, Bryan J, Chang W, McGowan LD, François R,\nGrolemund G, Hayes A, Henry L, Hester J, Kuhn M, Pedersen TL, Miller E,\nBache SM, Müller K, Ooms J, Robinson D, Seidel DP, Spinu V, Takahashi\nK, Vaughan D, Wilke C, Woo K, Yutani H (2019). \"Welcome to the\ntidyverse.\" _Journal of Open Source Software_, *4*(43), 1686.\ndoi:10.21105/joss.01686 <https://doi.org/10.21105/joss.01686>."
[1] "Sparks A (2018). \"nasapower: A NASA POWER Global Meteorology, Surface\nSolar Energy and Climatology Data Client for R.\" _The Journal of Open\nSource Software_, *3*(30), 1035. doi:10.21105/joss.01035\n<https://doi.org/10.21105/joss.01035>."
[1] "Lin G (2023). _reactable: Interactive Data Tables for R_.\ndoi:10.32614/CRAN.package.reactable\n<https://doi.org/10.32614/CRAN.package.reactable>, R package version\n0.4.4, <https://CRAN.R-project.org/package=reactable>."
[1] "Cuilla K (2022). _reactablefmtr: Streamlined Table Styling and\nFormatting for Reactable_. doi:10.32614/CRAN.package.reactablefmtr\n<https://doi.org/10.32614/CRAN.package.reactablefmtr>, R package\nversion 2.0.0, <https://CRAN.R-project.org/package=reactablefmtr>."
[1] "Cheng J, Sievert C, Schloerke B, Chang W, Xie Y, Allen J (2024).\n_htmltools: Tools for HTML_. doi:10.32614/CRAN.package.htmltools\n<https://doi.org/10.32614/CRAN.package.htmltools>, R package version\n0.5.8.1, <https://CRAN.R-project.org/package=htmltools>."
[1] "Vaidyanathan R, Xie Y, Allaire J, Cheng J, Sievert C, Russell K (2023).\n_htmlwidgets: HTML Widgets for R_.\ndoi:10.32614/CRAN.package.htmlwidgets\n<https://doi.org/10.32614/CRAN.package.htmlwidgets>, R package version\n1.6.4, <https://CRAN.R-project.org/package=htmlwidgets>."
[1] "Wickham H, Pedersen T, Seidel D (2025). _scales: Scale Functions for\nVisualization_. doi:10.32614/CRAN.package.scales\n<https://doi.org/10.32614/CRAN.package.scales>, R package version\n1.4.0, <https://CRAN.R-project.org/package=scales>."
[1] "Xie Y (2025). _knitr: A General-Purpose Package for Dynamic Report\nGeneration in R_. R package version 1.50, <https://yihui.org/knitr/>."
[2] "Xie Y (2015). _Dynamic Documents with R and knitr_, 2nd edition.\nChapman and Hall/CRC, Boca Raton, Florida. ISBN 978-1498716963,\n<https://yihui.org/knitr/>."
[3] "Xie Y (2014). \"knitr: A Comprehensive Tool for Reproducible Research in\nR.\" In Stodden V, Leisch F, Peng RD (eds.), _Implementing Reproducible\nComputational Research_. Chapman and Hall/CRC. ISBN 978-1466561595."
[1] "Pebesma E, Bivand R (2023). _Spatial Data Science: With applications in\nR_. Chapman and Hall/CRC. doi:10.1201/9780429459016\n<https://doi.org/10.1201/9780429459016>, <https://r-spatial.org/book/>."
[2] "Pebesma E (2018). \"Simple Features for R: Standardized Support for\nSpatial Vector Data.\" _The R Journal_, *10*(1), 439-446.\ndoi:10.32614/RJ-2018-009 <https://doi.org/10.32614/RJ-2018-009>,\n<https://doi.org/10.32614/RJ-2018-009>."
[1] "Cheng J, Schloerke B, Karambelkar B, Xie Y, Aden-Buie G (2025).\n_leaflet: Create Interactive Web Maps with the JavaScript 'Leaflet'\nLibrary_. doi:10.32614/CRAN.package.leaflet\n<https://doi.org/10.32614/CRAN.package.leaflet>, R package version\n2.2.3, <https://CRAN.R-project.org/package=leaflet>."
[1] "Roh T (2024). _leaflegend: Create Custom Legends for Leaflet_.\n<https://leaflegend.roh.engineering>."
[1] "Gatscha S, Karambelkar B, Schloerke B (2024). _leaflet.extras: Extra\nFunctionality for 'leaflet' Package_.\ndoi:10.32614/CRAN.package.leaflet.extras\n<https://doi.org/10.32614/CRAN.package.leaflet.extras>, R package\nversion 2.0.1, <https://CRAN.R-project.org/package=leaflet.extras>."